package com.amat0urheu.controller.teacherController;

import com.amat0urheu.pojo.ReturnRes;
import com.amat0urheu.service.SystemLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class SystemLogController {
    final SystemLogService systemLogService;

    @Autowired
    public SystemLogController(SystemLogService systemLogService) {
        this.systemLogService = systemLogService;
    }

    @GetMapping("/admin/systemLog/{pageSize}/{pageNum}")
    public ReturnRes getSystemLogPage(@PathVariable int pageSize,
                                   @PathVariable int pageNum) {
        return  systemLogService.getExperimentpage(pageSize,pageNum);
    }

    @PostMapping("/admin/removeSystemLog")
    public ReturnRes removeSystemLog(@RequestParam(name = "data") Integer id) {
        return  systemLogService.removeSystemLog(id);
    }

    @GetMapping("/admin/removeAllSystemLog")
    public ReturnRes removeAllSystemLog() {
        return  systemLogService.removeAllSystemLog();
    }
}

